#Include <WinAPI.au3>
WinActivate("World of Warcraft")
WinWaitActive("World of Warcraft")

Global $WinSize = GetWinSize("World of Warcraft")
Global $LootY = $WinSize[0] / 2
$LootY = $LootY + ($LootY / 2)
Global $LootX = $WinSize[1] / 2

MouseClick("right",$LootX, $LootY, 1, 0)

exit 

Func IsVisible($handle)
  If BitAnd( WinGetState($handle), 2 ) Then 
    Return 1
  Else
    Return 0
  EndIf

EndFunc

Func GetWinSize($Title)

	$var = WinList($Title)
	Local $hWnd;
	For $i = 1 to $var[0][0]
		; Only display visble windows that have a title
		If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then
			;MsgBox(0, "Details", "Title=" & $var[$i][0] & @LF & "Handle=" & $var[$i][1])
			$hWnd = $var[$i][1]
		EndIf
	Next
	local $result[2]

	$result[0] = _WinAPI_GetWindowHeight($hWnd)
	$result[1] = _WinAPI_GetWindowWidth($hWnd)

	return $result
EndFunc